package com.sc.nft.enums;

import cn.hutool.core.util.ArrayUtil;
import com.baomidou.mybatisplus.annotation.EnumValue;
import lombok.AllArgsConstructor;
import lombok.Getter;

@AllArgsConstructor
@Getter
public enum CollectionChainDealStatusEnum {
    IN_CHINA(0, "上链中"),
    TRADEABLE(1, "可交易"),
    TRADEDING(2, "交易中"),
    TRADED(3, "已交易(转赠)"),
    FROZEN(4, "跨链转增冻结中"),

    ;
    @EnumValue
    private int code;
    private String description;

    public static CollectionChainDealStatusEnum of(int code) {
        return ArrayUtil.firstMatch(item -> item.getCode() == code, CollectionChainDealStatusEnum.values());
    }

}
